<?php

namespace app\web\model;

use think\Model;

class WebTestModel extends Model
{
    public function add($serverName, $admin = '')
    {
        $this->data([
            'server_name' => $serverName,
            'admin_name'  => $admin
        ]);

        return $this->save();
    }

    public function saveWeb($serverName, $admin = '')
    {
        $this->data([
            'server_name' => $serverName,
            'admin_name'  => $admin,
            'status'      => 1
        ]);

        return $this->save();
    }

    public function saveStatus()
    {
        $this->data([
            'status' => 0
        ]);

        return $this->save();
    }

    public function saveCopyStatusToReplicable()
    {
        $this->data([
            'copy_status' => 1
        ]);

        return $this->save();
    }

    public function saveCopyStatusToNoReplicable()
    {
        $this->data([
            'copy_status' => 2
        ]);

        return $this->save();
    }
}